package com.great.service.impl;

import com.github.pagehelper.PageHelper;
import com.great.dao.ManageDao;
import com.great.domain.Manage;
import com.great.domain.User;
import com.great.service.ManageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class ManageServiceImpl implements ManageService {

    @Autowired
    private ManageDao manageDao;

    @Override
    public int managenamecheck(String manage_Name) {
        return manageDao.managenamecheck(manage_Name);
    }

    @Override
    public Manage selectbyname(String manage_Name, String manage_Password) {
        return manageDao.selectbyname(manage_Name, manage_Password);
    }


    @Override
    public List<Manage> searchmanage(int page, int size, String keyword) {
        PageHelper.startPage(page,size);
        return manageDao.searchmanage(keyword);
    }

    @Override
    public void delmanage(String id) {
        manageDao.delmanage(id);
    }

    @Override
    public void addmanage(Manage manage) {
        manageDao.addmanage(manage);
    }

    @Override
    public Manage finById(String id) {
        return manageDao.findById(id);
    }

    @Override
    public void updateById(Manage manage) {
        manageDao.updateById(manage);
    }
}
